<?php
/**
 * Enter description here ...
 * @author Micou13630
 *
 */
class ButtonItem extends CanvasItem implements IRenderable {

	protected $autoFit;

	protected $icon;

	protected $baseStyle;

	protected $buttonConstructor;
	protected $buttonProperties;
	
	protected $click;

	/**
	 * Constructeur
	 * @param unknown_type $name
	 */
	public function ButtonItem ($name = null, $type = Constant::EDITOR_TYPE_BUTTON) {
		parent::CanvasItem($name, $type);
	}

		
	/**
	 * Defini l'action du bouton
	 * @param FunctionType $func
	 */
	public function setJSClick($expression) {
		$this->click = new FunctionType(array('form','item'), $expression);
	} 
	
	/**
	 * Implementation de object
	 * @see IRenderable::object()
	 */
	public function object() {
		return get_class($this);
	}

	/**
	 * Implementation de properties
	 * @see IRenderable::properties()
	 */
	public function properties() {
		return parent::getProp($this);
	}

	/**
	 * Implementation de properties
	 * @see IRenderable::scLog()
	 */
	public function scLog() {
		ScCollectionLog::getInstance()->addSc(new ScLog($this->object(), get_object_vars($this)));
	}
	
	/**
	 * Implementation de render
	 * @see IScreen::render()
	 */
	public function render() {
		$this->scLog();
		return "{".$this->properties()."}";
	}
}
?>